package shovelsoft.btmetaparser.structs;

import java.util.List;

import shovelsoft.btmetaparser.tokens.IToken;

/***
 * Implements a leaf node. Leaf nodes may represent Data/Integer and End Tokens
 * @author cds
 */
public class Leaf extends Node {

	/***
	 * Create a Leaf Node
	 * @param token associate this leaf with the given token
	 * @param parent the parent of this mode
	 */
	public Leaf(IToken token, INode parent) {
		
		super(token, parent);
	}
	
	/***
	 * Throws exception, cannot add children to leaf nodes
	 */
	@Override
	public void addChild(INode child) throws Exception {
		
		throw new Exception("parse error: cannot add child to leaf node");
	}

	/***
	 * Get list of children ( always null ) for Leaf
	 */
	@Override
	public List<INode> getChildren() {

		return null;
	}
}

